int redled = 1;
int yellowLed = 2;
int greedLed = 0;
int time = 29;
int timesec = 50;

void myDelay(int timei)
{
 while(timei --)
 {
    delay(1);
 }
}
void ledBlink(int count)
{
  while(count --)
  {
    digitalWrite(redled, HIGH);   // turn the LED on (HIGH is the voltage level)
    myDelay(100);  
    digitalWrite(redled, LOW);    // turn the LED off by making the voltage LOW
    myDelay(100);  
  }
}
// the setup routine runs once when you press reset:
void setup() {                
  pinMode(redled, OUTPUT);    
  pinMode(greedLed, OUTPUT);  
  ledBlink(10);
}
// the loop routine runs over and over again forever:
void loop() {
  //time
  myDelay(1000);
  timesec ++;
  if(timesec >=60 )
  {
    timesec = 0;
    time ++ ;
  }
  //LED 
  if(time < 25){
    digitalWrite(greedLed, LOW); 
    digitalWrite(redled, LOW);
  }
  else if(time < 30){
    digitalWrite(greedLed, HIGH);
    digitalWrite(redled, timesec%2);
  }
  else {time = 0;}  
}



